home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
comm2
/
termsorc.lha
/
Extras
/
Source
/
gtlayout-source.lha
/
LT_GetMenuItem.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-24
|
720b
|
38 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#include "gtlayout_global.h"
#ifdef DO_MENUS
/* LT_GetMenuItem(struct Menu *Menu,ULONG ID):
*
* Obtain the menu item associated with the ID.
*/
struct MenuItem * LIBENT
LT_GetMenuItem(REG(a0) struct Menu *Menu,REG(d0) ULONG ID)
{
RootMenu *Root = (RootMenu *)((ULONG)Menu - offsetof(RootMenu,Menu));
ItemNode *Item;
// Run down the list...
for(Item = (ItemNode *)Root -> ItemList . mlh_Head ; Item -> Node . mln_Succ ; Item = (ItemNode *)Item -> Node . mln_Succ)
{
if(Item -> ID == ID)
return(&Item -> Item);
}
// Nothing found
return(NULL);
}
#endif /* DO_MENUS */